<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/6/14 0014
  Time: 14:27下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <script>
        function check() {
            alert("=====天王盖地虎======"+"=====小鸡炖蘑菇======")
        }
        function fun() {
            //alert("=====小鸡炖蘑菇======")
            var xmlhttp;
            if (window.XMLHttpRequest) {
                //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
                xmlhttp=new XMLHttpRequest();
            }else {
                // IE6, IE5 浏览器执行代码
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange=function() {
                if (xmlhttp.readyState==4 && xmlhttp.status==200) {
                    document.getElementById("show").innerHTML=xmlhttp.responseText;
                }
            }
            xmlhttp.open("GET","http://localhost:8080/javaweb_shopping/AjaxServlet",true);
            xmlhttp.send();
        }
    </script>
    <button onclick="check()">请点击我</button><br>

    用户名：<input type="text" name="uname" id="uname" value="" onblur="fun()">
    <span id="show"></span>
</body>
</html>
